﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;
using Frame.Pages;


public partial class EditConsumerMDay : Frame.Pages.FliterBIEditBasePage<DAL.BLI_Consumer_MDay>
{

    protected override Func<DAL.BLI_Consumer_MDay, bool> FliterExpression
    {
        get
        {


            if (RefrenceContext<DAL.BI_Consumer>.Current != null)
            {
                return new Func<BLI_Consumer_MDay, bool>(o => o.Consumer_ID == RefrenceContext<DAL.BI_Consumer>.Current.Model.ConsumerID);
            }
            else
            {
                return null;
            }

        }
    }
    /// <summary>
    /// 权限编码，需要重新设置
    /// </summary>
    protected override string ActionID
    {
        get { return "0"; }
    }

    protected override void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        if (!IsPostBack && !IsCallback)
        {
            if (RefrenceContext<DAL.BI_Consumer>.Current != null)
            {
                Backlink.NavigateUrl = (RefrenceContext<DAL.BI_Consumer>.Current == null ? string.Empty : RefrenceContext<DAL.BI_Consumer>.Current.BackUrl);
                WebUtility.MappingConsumerView(Detailpanel, RefrenceContext<DAL.BI_Consumer>.Current.Model);
            }
            
        }

    }
    protected void gridView_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
    {
        e.NewValues["Consumer_ID"] = RefrenceContext<DAL.BI_Consumer>.Current.Model.ConsumerID;
    }

}